/*
   Copyright 2009 Marcin Szczepanski, webqem (marcins@gmail.com)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package webqem.wave.api
{
	public interface IGadgetAPI
	{
		
		function get isInWave():Boolean;
		
		function IGadgetAPI();
		
		/**
		 * This function sets up the Wave API by registering the callbacks
		 * for state and participant changes.
		 * 
		 * @param gadgetName this Gadget's name, in case it is required by
		 * the implementation
		 * @param waveStateCallback the callback function that will be called
		 * when there is a state change event from Wave
		 * @param waveParticipantCallback the callback function that will be
		 * called when there is a participant change event from Wave
		 */
		function initialiseAndSetCallbacks(
            gadgetName:String,
            waveStateCallback:Function, 
            waveParticipantCallback:Function,
            waveModeCallback:Function
            ):void;
            
		function getState(key:String, defaultValue:String):Object;
		function getStateKeys():Array;
		function getWaveMode():String;
	 	function submitDelta(delta:Object):void;
		function stateToString():String;
		function getViewer():String;
		function getHost():String;
		function getAllParticipants():Array;
		function getParticipantDisplayName(id:String):String;
		function getParticipantThumbnailUrl(id:String):String;
		
	}
}